﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TransCode.Logic;

namespace TransCode.Player.TargetPage
{
    /// <summary>
    /// Interaction logic for QueryDefault.xaml
    /// </summary>
    public partial class QueryDefault : UserControl
    {
        public QueryDefault()
        {
            InitializeComponent();

            beginPicker.SelectedDate = DateTime.Now.AddDays(-1);
            endPicker.SelectedDate = DateTime.Now.AddDays(1);
        }

        TargetObjectLogic tlogic = new TargetObjectLogic();

        private void btnQuery_Click(object sender, RoutedEventArgs e)
        {
            Query();
        }

        void Query()
        {
            IDictionary<string, object> args = new Dictionary<string, object>(); // TODO: Initialize to an appropriate value
            args.Add("BeginTime", beginPicker.SelectedDate.Value);
            args.Add("EndTime", endPicker.SelectedDate.Value);
            args.Add("Type", targetType.SelectionBoxItem);
            args.Add("Color", targetColor.Text);

            Common.TargetObjectMainPage.Query(args);
        }
    }
}
